
using System.Data.Entity.ModelConfiguration;

namespace OBUCare.Core.Models.Mapping
{
    public class View_Operator_InvoiceInfosMap : EntityTypeConfiguration<View_Operator_InvoiceInfos>
    {
        public View_Operator_InvoiceInfosMap()
        {
            // Primary Key
            this.HasKey(t => new { t.AGENT_NO, t.OPERATOR_NO, t.INVOICE_TYPE, t.FeeType });

            // Properties
            this.Property(t => t.AGENT_NO)
                .IsRequired()
                .HasMaxLength(12);

            this.Property(t => t.AGENT_NAME)
                .HasMaxLength(50);

            this.Property(t => t.OPERATOR_NO)
                .IsRequired()
                .HasMaxLength(6);

            this.Property(t => t.OPERATOR_NAME)
                .HasMaxLength(50);

          

            this.Property(t => t.FeeType)
                .IsRequired()
                .HasMaxLength(6);

            // Table & Column Mappings
            this.ToTable("View_Operator_InvoiceInfos");
            this.Property(t => t.AGENT_NO).HasColumnName("AGENT_NO");
            this.Property(t => t.AGENT_NAME).HasColumnName("AGENT_NAME");
            this.Property(t => t.OPERATOR_NO).HasColumnName("OPERATOR_NO");
            this.Property(t => t.OPERATOR_NAME).HasColumnName("OPERATOR_NAME");
            this.Property(t => t.FUND_AMOUNT).HasColumnName("FUND_AMOUNT");
            this.Property(t => t.INVOICE_TYPE).HasColumnName("INVOICE_TYPE");
            this.Property(t => t.InvoiceCount).HasColumnName("InvoiceCount");
            this.Property(t => t.Amount).HasColumnName("Amount");
            this.Property(t => t.FeeType).HasColumnName("FeeType");
            this.Property(t => t.RECORD_TIME).HasColumnName("RECORD_TIME");
        }
    }
}
